
/*
 * Copyright 2002-2014 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2014原作者。
 *
 *根据Apache许可证2.0版许可（“许可证”）；
 *除非符合许可证的规定，否则您不得使用此文件。
 *您可以在以下网址获取许可证副本：
 *
 *https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证进行的分发是在“按原样”的基础上进行的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限的特定语言，请参阅许可证
 *许可下的限制。
 */

package org.springframework.mail;

/**
 * This interface defines a strategy for sending simple mails. Can be
 * implemented for a variety of mailing systems due to the simple requirements.
 * For richer functionality like MIME messages, consider JavaMailSender.
 *
 * <p>Allows for easy testing of clients, as it does not depend on JavaMail's
 * infrastructure classes: no mocking of JavaMail Session or Transport necessary.
 *
 * @author Dmitriy Kopylenko
 * @author Juergen Hoeller
 * @since 10.09.2003
 * @see org.springframework.mail.javamail.JavaMailSender
 */
/**
 *这个接口定义了发送简单邮件的策略。可以
 *由于简单的要求，实现了各种邮件系统。
 *要获得更丰富的功能（如MIME消息），请考虑JavaMailSender。
 *
 *<p>允许轻松测试客户端，因为它不依赖于JavaMail
 *基础结构类：不需要对JavaMail会话或传输进行嘲讽。
 *
 *@作者德米特里·科皮连科
 *@作者Juergen Hoeller
 *@自2003年9月10日起
 *@参见org.springframework.mail.javamail.JavaMailSender
 */
public interface MailSender {

	/**
	 * Send the given simple mail message.
	 * @param simpleMessage the message to send
	 * @throws MailParseException in case of failure when parsing the message
	 * @throws MailAuthenticationException in case of authentication failure
	 * @throws MailSendException in case of failure when sending the message
	 */
	/**
	 *发送给定的简单邮件。
	 *@param simpleMessage要发送的消息
	 *@throws MailParseException，以防解析消息失败
	 *身份验证失败时@throws MailAuthenticationException
	 *发送消息失败时@throws MailSendException
	 */
	void send(SimpleMailMessage simpleMessage) throws MailException;

	/**
	 * Send the given array of simple mail messages in batch.
	 * @param simpleMessages the messages to send
	 * @throws MailParseException in case of failure when parsing a message
	 * @throws MailAuthenticationException in case of authentication failure
	 * @throws MailSendException in case of failure when sending a message
	 */
	/**
	 *批量发送给定的简单邮件数组。
	 *@param simpleMessages要发送的消息
	 *@throws MailParseException，以防解析消息失败
	 *身份验证失败时@throws MailAuthenticationException
	 *发送消息失败时@throws MailSendException
	 */
	void send(SimpleMailMessage... simpleMessages) throws MailException;

}
